<script setup>
//弹窗关闭
import {onMounted, ref} from "vue";
import {doGet} from "@/util/request.js";
import {showMessage} from "@/util/message.js";
import {useRoute, useRouter} from "vue-router";

const router = useRouter();
const route = useRoute();
const dialogVisible = ref(true);
//获取详情对象
const tranDetail = ref({});
//获取详情信息
const getTranDetail = () => {
  let tranId = route.params.id;
  doGet('/api/tran/detail/' + tranId,{}).then(res => {
    if (res.data.code === 200){
      tranDetail.value = res.data.data
    }
    else {
      showMessage('查询交易详情失败'+res.data.msg, 'error')
    }
  })
}
onMounted(()=>{
  getTranDetail()
})
</script>

<template>
  <el-dialog
      v-model="dialogVisible"
      width="700"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      :align-center="true"
      :center="true"
      :show-close="false"
      title="交易详情">

    <el-form :model="tranDetail" style="margin-left: 100px">
      <el-form-item label="编号: ">
        {{ tranDetail.id }}
      </el-form-item>
      <el-form-item label="交易流水号: ">
        {{ tranDetail.tranNo }}
      </el-form-item>

      <el-form-item label="客户姓名: ">
        {{ tranDetail.customerName }}
      </el-form-item>

      <el-form-item label="交易金额: ">
        {{ tranDetail.money }}
      </el-form-item>

      <el-form-item label="预计成交日期: ">
        {{ tranDetail.expectedDate }}
      </el-form-item>

      <el-form-item label="交易所处阶段: ">
        {{ tranDetail.stageName }}
      </el-form-item>

      <el-form-item label="下次联系时间: ">
        {{ tranDetail.nextContactTime }}
      </el-form-item>

      <el-form-item label="交易描述: ">
        <!--<el-input type="textarea" v-model="tranDetail.description" :rows="3" :maxlength="200" show-word-limit readonly/>-->
        {{ tranDetail.description }}
      </el-form-item>

      <el-form-item label="创建人: ">
        {{ tranDetail.createByName }}
      </el-form-item>

      <el-form-item label="创建时间: ">
        {{ tranDetail.createTime }}
      </el-form-item>

      <el-form-item label="编辑人: ">
        {{ tranDetail.editByName }}
      </el-form-item>

      <el-form-item label="编辑时间: ">
        {{ tranDetail.editTime }}
      </el-form-item>

    </el-form>
    <div style="margin-left: 550px">
      <el-button type="primary" @click="router.back()">返回</el-button>
    </div>
  </el-dialog>
</template>

<style scoped>

</style>